{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Define parameters"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from data_processing_modules import *\n",
    "\n",
    "# ####################\n",
    "# Defind parameters\n",
    "# ####################\n",
    "\n",
    "project_par = {\n",
    "    'data_input_path'   :  '/Volumes/Public/Singapore_shutdown/Raw/park_data_1/',\n",
    "    'data_output_path'  :  './OutputData_S16',\n",
    "    'fig_output_path'   :  './OutFigs',\n",
    "    \n",
    "    'stations'          :  {'S16':['1732'],\n",
    "                           },\n",
    "    'components'        :  ['N'],\n",
    "    \n",
    "    'verbosity'         :  True,\n",
    "    'local_timezone'    :  True,  # correct time zone to local time\n",
    "#     'proj_time_bgn'     :  UTCDateTime(2020,4,9,0,0,0),   # section begin time\n",
    "#     'proj_time_end'     :  UTCDateTime(2020,4,10,0,59,59), # section end time\n",
    "    \n",
    "}\n",
    "\n",
    "processing_par = {\n",
    "\n",
    "    # remove response\n",
    "    'remove_response'   : False,\n",
    "    \n",
    "    # resampling\n",
    "    'downsampling_rate' : 0.002,\n",
    "    \n",
    "    # highpass filter\n",
    "    'freq_highpass'     : 0.1,\n",
    "\n",
    "    # PSD\n",
    "    'PSD_winlen'        : 24*3600, # second, time length for output PSD\n",
    "    \n",
    "    # identify footsteps\n",
    "    'winlen_spc'        : 3600,  # sec, time window length for calculating spectrogram\n",
    "    'winlen_events'     : 3600, # sec, time window length for counting events\n",
    "    'sampleRate'        : 500,\n",
    "    'tw'                : 3,\n",
    "    'ntw'               : 4,\n",
    "    'f_min'             : 40,  \n",
    "    'f_max'             : 100,   \n",
    "    'pf_min'            : 2,\n",
    "    'pf_max'            : 4,\n",
    "    'a_p'               : 0.13,\n",
    "    'eps'               : 0.2,\n",
    "    'hf_l'              : 80,\n",
    "    'hf_h'              : 100,\n",
    "    'a_mn'              : 0.2,\n",
    "    'f_l'               : 2,\n",
    "    'f_h'               : 8,\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Processing flow"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ">>> Create input data_list and station_list!\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.19.2020.04.25.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.27.2020.05.03.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.30.2020.05.06.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.7.2020.04.13.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.28.2020.05.04.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.32.2020.05.08.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.14.2020.04.20.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.17.2020.04.23.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.31.2020.05.07.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.25.2020.05.01.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.2.2020.04.08.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.9.2020.04.15.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.21.2020.04.27.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.29.2020.05.05.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.4.2020.04.10.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.8.2020.04.14.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.16.2020.04.22.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.15.2020.04.21.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.26.2020.05.02.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.23.2020.04.29.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.12.2020.04.18.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.3.2020.04.09.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.5.2020.04.11.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.20.2020.04.26.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.13.2020.04.19.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.22.2020.04.28.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.11.2020.04.17.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.10.2020.04.16.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.6.2020.04.12.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.18.2020.04.24.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.24.2020.04.30.11.00.00.000.N.sac\n",
      "/Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.1.2020.04.07.14.41.12.000.N.sac\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.19.2020.04.25.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-25T11:00:00.000000Z - 2020-04-26T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-25T19:00:00.000000Z - 2020-04-26T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-25T19:00:00.000000Z - 2020-04-26T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.27.2020.05.03.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-05-03T11:00:00.000000Z - 2020-05-04T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-03T19:00:00.000000Z - 2020-05-04T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-03T19:00:00.000000Z - 2020-05-04T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.30.2020.05.06.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-05-06T11:00:00.000000Z - 2020-05-07T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-06T19:00:00.000000Z - 2020-05-07T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-06T19:00:00.000000Z - 2020-05-07T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.7.2020.04.13.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-13T11:00:00.000000Z - 2020-04-14T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-13T19:00:00.000000Z - 2020-04-14T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-13T19:00:00.000000Z - 2020-04-14T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.28.2020.05.04.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-05-04T11:00:00.000000Z - 2020-05-05T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-04T19:00:00.000000Z - 2020-05-05T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-04T19:00:00.000000Z - 2020-05-05T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.32.2020.05.08.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-05-08T11:00:00.000000Z - 2020-05-08T23:29:36.002745Z | 500.0 Hz, 22488001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-08T19:00:00.000000Z - 2020-05-09T07:29:36.002745Z | 500.0 Hz, 22488001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-08T19:00:00.000000Z - 2020-05-09T07:29:36.000000Z | 500.0 Hz, 22488001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.14.2020.04.20.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-20T11:00:00.000000Z - 2020-04-21T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-20T19:00:00.000000Z - 2020-04-21T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-20T19:00:00.000000Z - 2020-04-21T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.17.2020.04.23.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-23T11:00:00.000000Z - 2020-04-24T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-23T19:00:00.000000Z - 2020-04-24T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-23T19:00:00.000000Z - 2020-04-24T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.31.2020.05.07.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-05-07T11:00:00.000000Z - 2020-05-08T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-07T19:00:00.000000Z - 2020-05-08T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-07T19:00:00.000000Z - 2020-05-08T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.25.2020.05.01.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-05-01T11:00:00.000000Z - 2020-05-02T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-01T19:00:00.000000Z - 2020-05-02T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-01T19:00:00.000000Z - 2020-05-02T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.2.2020.04.08.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-08T11:00:00.000000Z - 2020-04-09T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-08T19:00:00.000000Z - 2020-04-09T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-08T19:00:00.000000Z - 2020-04-09T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.9.2020.04.15.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-15T11:00:00.000000Z - 2020-04-16T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-15T19:00:00.000000Z - 2020-04-16T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-15T19:00:00.000000Z - 2020-04-16T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.21.2020.04.27.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-27T11:00:00.000000Z - 2020-04-28T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-27T19:00:00.000000Z - 2020-04-28T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-27T19:00:00.000000Z - 2020-04-28T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.29.2020.05.05.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-05-05T11:00:00.000000Z - 2020-05-06T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-05T19:00:00.000000Z - 2020-05-06T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-05T19:00:00.000000Z - 2020-05-06T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.4.2020.04.10.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-10T11:00:00.000000Z - 2020-04-11T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-10T19:00:00.000000Z - 2020-04-11T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-10T19:00:00.000000Z - 2020-04-11T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.8.2020.04.14.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-14T11:00:00.000000Z - 2020-04-15T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-14T19:00:00.000000Z - 2020-04-15T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-14T19:00:00.000000Z - 2020-04-15T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.16.2020.04.22.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-22T11:00:00.000000Z - 2020-04-23T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-22T19:00:00.000000Z - 2020-04-23T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-22T19:00:00.000000Z - 2020-04-23T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.15.2020.04.21.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-21T11:00:00.000000Z - 2020-04-22T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-21T19:00:00.000000Z - 2020-04-22T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-21T19:00:00.000000Z - 2020-04-22T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.26.2020.05.02.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-05-02T11:00:00.000000Z - 2020-05-03T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-02T19:00:00.000000Z - 2020-05-03T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-05-02T19:00:00.000000Z - 2020-05-03T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.23.2020.04.29.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-29T11:00:00.000000Z - 2020-04-30T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-29T19:00:00.000000Z - 2020-04-30T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-29T19:00:00.000000Z - 2020-04-30T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.12.2020.04.18.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-18T11:00:00.000000Z - 2020-04-19T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-18T19:00:00.000000Z - 2020-04-19T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-18T19:00:00.000000Z - 2020-04-19T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.3.2020.04.09.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-09T11:00:00.000000Z - 2020-04-10T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-09T19:00:00.000000Z - 2020-04-10T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-09T19:00:00.000000Z - 2020-04-10T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.5.2020.04.11.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-11T11:00:00.000000Z - 2020-04-12T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-11T19:00:00.000000Z - 2020-04-12T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-11T19:00:00.000000Z - 2020-04-12T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.20.2020.04.26.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-26T11:00:00.000000Z - 2020-04-27T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-26T19:00:00.000000Z - 2020-04-27T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-26T19:00:00.000000Z - 2020-04-27T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.13.2020.04.19.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-19T11:00:00.000000Z - 2020-04-20T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-19T19:00:00.000000Z - 2020-04-20T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-19T19:00:00.000000Z - 2020-04-20T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.22.2020.04.28.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-28T11:00:00.000000Z - 2020-04-29T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-28T19:00:00.000000Z - 2020-04-29T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-28T19:00:00.000000Z - 2020-04-29T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.11.2020.04.17.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-17T11:00:00.000000Z - 2020-04-18T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-17T19:00:00.000000Z - 2020-04-18T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-17T19:00:00.000000Z - 2020-04-18T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.10.2020.04.16.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-16T11:00:00.000000Z - 2020-04-17T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-16T19:00:00.000000Z - 2020-04-17T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-16T19:00:00.000000Z - 2020-04-17T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.6.2020.04.12.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-12T11:00:00.000000Z - 2020-04-13T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-12T19:00:00.000000Z - 2020-04-13T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-12T19:00:00.000000Z - 2020-04-13T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.18.2020.04.24.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-24T11:00:00.000000Z - 2020-04-25T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-24T19:00:00.000000Z - 2020-04-25T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-24T19:00:00.000000Z - 2020-04-25T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.24.2020.04.30.11.00.00.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-30T11:00:00.000000Z - 2020-05-01T11:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-30T19:00:00.000000Z - 2020-05-01T19:00:00.005273Z | 500.0 Hz, 43200001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-30T19:00:00.000000Z - 2020-05-01T19:00:00.000000Z | 500.0 Hz, 43200001 samples\n",
      " Find footstep events!\n",
      " >>> Read data from /Volumes/Public/Singapore_shutdown/Raw/phase1/453001732..0.1.2020.04.07.14.41.12.000.N.sac\n",
      "1 Trace(s) in Stream:\n",
      ".3001732..N | 2020-04-07T14:41:12.000000Z - 2020-04-08T11:00:00.004463Z | 500.0 Hz, 36564001 samples\n",
      " Pre-processing:  correct time-zone \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-07T22:41:12.000000Z - 2020-04-08T19:00:00.004463Z | 500.0 Hz, 36564001 samples\n",
      " High pass filter @0.100000 Hz \n",
      "1 Trace(s) in Stream:\n",
      "S16.3001732..N | 2020-04-07T22:41:12.000000Z - 2020-04-08T19:00:00.000000Z | 500.0 Hz, 36564001 samples\n",
      " Find footstep events!\n"
     ]
    }
   ],
   "source": [
    "# ######################\n",
    "# Data processing flow\n",
    "# ######################\n",
    "%matplotlib inline\n",
    "\n",
    "\n",
    "# initial DataProcessing class\n",
    "dp = DataProcessing(project_par, processing_par, default_par)    \n",
    "\n",
    "# get data list\n",
    "dp.getdatalist()\n",
    "\n",
    "for files in dp.data_list:\n",
    "    \n",
    "    dp.readdata(files)\n",
    "    dp.preprocessing()\n",
    "    dp.high_pass()\n",
    "    #dp.psd()\n",
    "    dp.footstep_events()\n",
    "    \n",
    "plt.close()   "
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
